package org.mybatis.generator.entity;

import java.util.List;

/**
 * @author hedong
 * @version 1.0
 * @date 2020/6/18
 * @since JDK1.8
 */
public class TableMeta {

    private String tableName;

    private String remarks;

    private List<ColumnMeta> columnMetas;

    public TableMeta() {
    }

    public TableMeta(String tableName, String remarks) {
        this.tableName = tableName;
        this.remarks = remarks;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public List<ColumnMeta> getColumnMetas() {
        return columnMetas;
    }

    public void setColumnMetas(List<ColumnMeta> columnMetas) {
        this.columnMetas = columnMetas;
    }

    public ColumnMeta getColumnMeta(String columnName) {
        if (columnMetas != null) {
            for (ColumnMeta columnMeta : columnMetas) {
                if (columnMeta.getColumnName().equals(columnName)) {
                    return columnMeta;
                }
            }
        }
        return null;
    }
}
